<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
	String path = request.getContextPath();
%>

<form id="pagerForm" onsubmit="return navTabSearch(this);" action="backBorrowOrder/getBorrowPage?bType=${bType}&myId=${params.myId}" method="post">
	<div class="pageHeader">
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<td>
						订单号:
						<input type="text" name="outTradeNo"
							value="${params.outTradeNo }" />
					</td>
					<td>
						用户姓名:
						<input type="text" name="realname"
							value="${params.realname }" />
					</td>
					<td>
						手机:
						<input type="text" name="userPhone"
							value="${params.userPhone }" />
					</td>
					<td>
						公司名称:
						<input type="text" name="companyName"
							value="${params.companyName }" />
					</td>
					<td>
							状态：
							<select name="borrowStatus">
								<option value="">全部</option>
								
								
								
								<c:forEach var="borrowStatus" items="${BORROW_STATUS_ALL}">
								
								<c:choose>
								<c:when test="${bType=='fengk_Trial'}">
								
									<c:if test="${
							borrowStatus.key eq STATUS_CSTG 
							or borrowStatus.key eq STATUS_DCS
							or borrowStatus.key eq STATUS_CSBH
							}">
									<option value="${borrowStatus.key}" <c:if test="${borrowStatus.key eq params.borrowStatus}">selected="selected"</c:if> >${borrowStatus.value}</option>
									</c:if>

								</c:when>
								<c:when test="${bType=='fengk_Review'}">
								
									<c:if test="${borrowStatus.key eq STATUS_FSTG 
							or borrowStatus.key eq STATUS_CSTG 
							or borrowStatus.key eq STATUS_FSBH
							or borrowStatus.key eq STATUS_FSTG}">
									<option value="${borrowStatus.key}" <c:if test="${borrowStatus.key eq params.borrowStatus}">selected="selected"</c:if> >${borrowStatus.value}</option>
									</c:if>

								</c:when>
								<c:otherwise>
								<option value="${borrowStatus.key}" <c:if test="${borrowStatus.key eq params.borrowStatus}">selected="selected"</c:if> >${borrowStatus.value}</option>
								</c:otherwise>
								
								</c:choose>
								
							
								</c:forEach>
								
								
								
							</select>
						</td>
					<td>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">
									查询
								</button>
							</div>
						</div>
					</td>
				</tr>
			</table>
		</div>
	</div>
	<div class="pageContent">
	 
		
			<jsp:include page="${BACK_URL}/rightSubList">
			<jsp:param value="${params.myId}" name="parentId"/>
		</jsp:include>
			<table class="table" style="width: 100%;" layoutH="112" nowrapTD="false">
				<thead>
					<tr >
						<th align="center"  >
							序号
						</th>
						<th align="left"  >
							订单号
						</th>
						<th align="center"  >
							姓名
						</th>
						<th align="center" >
							手机号
						</th>
						<th align="center"  >
							是否是老用户
						</th>
						<th align="center" >
							借款金额(元)
						</th>
						<th align="center"  >
								借款期限
						</th>
						<th align="center" >
								服务费利率(万分之一)
						</th>
						<th align="center" >
								服务费(元)
						</th>
						<th align="center" >
							申请时间
						</th>
					 
						<th align="center" >
							公司名称
						</th>
				 
						<c:if test="${param.bType=='fk' }">
						<th align="center" >
							放款时间	
						</th>
						
						</c:if>
						<th align="center"  >
								子类型	
						</th>
						<th align="center"  >
							状态
						</th>
<!-- 						<th align="center"  > -->
<!-- 							操作 -->
<!-- 						</th> -->
					</tr>
				</thead>
				<tbody>
					<c:forEach var="borrow" items="${pm.items }" varStatus="status">
						<tr  target="sid_support" rel="${borrow.id }"  >
							<td>
								${status.count}
							</td>
							<td>
								${borrow.outTradeNo}
							</td>
							<td>
${borrow.user.realname}
							</td>
							<td>
							${borrow.user.userPhone }
 
							</td>
							<td>
								${borrow.user.customerTypeName}
							</td>
							<td>
<%--  							${borrow.moneyAmount/100 } --%>
 							<fmt:formatNumber type="number" value="${borrow.moneyAmount/100}" pattern="0.00" maxFractionDigits="0"/>
							</td>
									<td>
									
								${borrow.loanTerm }	
 
							</td>
								<td>
								 
								 							<fmt:formatNumber type="number" value="${borrow.apr}" pattern="0.00" maxFractionDigits="0"/>
							</td>
 		<td>                                                                                                                     
							<fmt:formatNumber type="number" value="${borrow.loanInterests/100}" pattern="0.00" maxFractionDigits="2"/>
							</td>
									<td>
 							<fmt:formatDate value="${borrow.orderTime }" pattern="yyyy-MM-dd HH:mm:ss"/>
							</td>
						 
						<td>
							${borrow.user.companyName} 
						</td>
				 
							<c:if test="${param.bType=='fk' }">
					<td>
 							<fmt:formatDate value="${borrow.loanTime }" pattern="yyyy-MM-dd HH:mm:ss"/>
							</td>
						
						</c:if>
									<td>
 						${borrow.orderTypeName }
							</td>
									<td>
 ${borrow.statusName }	
							</td>
 
						</tr>
					</c:forEach>
				</tbody>
			</table>
			<c:set var="page" value="${pm }"></c:set>
		<!-- 分页 -->
		<%@ include file="../page.jsp"%>
	</div>
</form>
	 
<script type="text/javascript">
	if("${message}"){
		alertMsg.error(${message});
	}
</script>